<?php
namespace Home\Controller;
use Think\Controller;

class CommonController extends Controller{
    //初始化方法(构造方法)
    public function _initialize(){
       if(!session('?home')) {
           $this->error('请登录',U('Login/index'));
       }
    }

    static public function sub($str)
    {
        return substr($str, 0,4).'/'.substr($str, 4,2).'/'.substr($str, 6,2).'/';
    }

}

?>